<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Empty</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .empty:empty {
            height: 30px;
            background-color: skyblue;
        }

        .empty:empty::after {
            content: 'empty'
        }

        .input:placeholder-shown::placeholder {
            color: transparent;
        }

        .g {
            position: relative;
        }

        .input-label {
            position: absolute;
            left: 16px;
            top: 14px;
            pointer-events: none;
            background: #fff;
            padding: 0 10px;
            transition:.3s;
        }

        .input {
            line-height: 3.5;
        }

        .input:not(:placeholder-shown)+.input-label,
        .input:focus+.input-label {
            transform: scale(.75) translate(0, -32px);
        }
    </style>
</head>

<body>
    <div class="empty"></div>

    <div class="g">
        <input class="input" placeholder="邮箱" />
        <label for="" class="input-label">邮箱</label>
    </div>
</body>

</html>